import request from '@/utils/request'
// 流程环节组定义 API接口
const act_dsn_form_scatApi = {
  list: '/act_dsn_form_scat/list',
  save: '/act_dsn_form_scat/save',
  view: '/act_dsn_form_scat/view',
  del: '/act_dsn_form_scat/delete',
  dels: '/act_dsn_form_scat/batchDel',
  output: '/act_dsn_form_scat/output',
  exportExcelTemplate: '/act_dsn_form_scat/exportExcelTemplate',
  importExcel: '/act_dsn_form_scat/importExcel',
  saveAll: '/act_dsn_form_scat/saveAll',
  findAllByFormid: '/act_dsn_form_scat/findAllByFormid'
}

/**
 * 批量删除流程环节组定义
 * @param {*} ids
 */
 export function findAllByFormid(formid, modelKey) {
  return request({
    url: act_dsn_form_scatApi.findAllByFormid,
    method: 'post',
    params: {formid, modelKey}
  })
}

/**
 * 导入流程环节组定义Excel
 */
export function importExcel(data) {
  var body = new FormData()
  body.append("file", data);
  return request({
    url: act_dsn_form_scatApi.importExcel,
    headers: {
      "Content-Type": "multipart/form-data"
    },
    method: 'post',
    data: body
  })
}

/**
 * 导出流程环节组定义Excel模板
 */
export function exportExcelTemplate() {
  return request({
    url: act_dsn_form_scatApi.exportExcelTemplate,
    method: 'post',
    responseType: 'blob'
  })
}

/**
 * 导出流程环节组定义
 */
export function output(data) {
  return request({
    url: act_dsn_form_scatApi.output,
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}
/**
 * 批量删除流程环节组定义
 * @param {*} ids
 */
export function delAct_dsn_form_scats(ids) {
  return request({
    url: act_dsn_form_scatApi.dels,
    method: 'post',
    params: {
      ids
    }
  })
}
/**
 * 删除流程环节组定义
 * @param {*} id
 */
export function delAct_dsn_form_scat(id) {
  return request({
    url: act_dsn_form_scatApi.del,
    method: 'post',
    params: {
      id
    }
  })
}
/**
 * 查看、编辑流程环节组定义
 * @param {*} id
 */
export function viewAct_dsn_form_scat(id) {
  return request({
    url: act_dsn_form_scatApi.view,
    method: 'get',
    params: {
      id
    }
  })
}
/**
 * 保存流程环节组定义
 * @param {*} body
 */
export function saveAct_dsn_form_scat(body) {
  return request({
    url: act_dsn_form_scatApi.save,
    method: 'post',
    data: body
  })
}
/**
 * 查询流程环节组定义列表
 * @param {*} body
 */
export function queryAct_dsn_form_scatList(body) {
  return request({
    url: act_dsn_form_scatApi.list,
    method: 'post',
    data: body
  })
}

/**
 * 批量保存
 * @param formid 表单id
 * @param list
 * @return
 */
export function saveAll(formid, body) {
  return request({
    url: act_dsn_form_scatApi.saveAll,
    method: 'post',
    params: {
      formid
    },
    data: body
  })
}